#!/usr/bin/python

import urllib2
import urllib
import BeautifulSoup

coupang_url = "http://rss.socialportal.co.kr/socialxml_utf8.php?mid=coupang&id=again4you"

def get_data():
	# get data
	try:
		retData = urllib2.urlopen(coupang_url).read()
	except urllib2.HTTPError, e:
		print "Http Error: %d" % e.code
	except urllib2.URLError, e:
		print "Network error: %s" % e.reason.args[1]

	# parsing data
	soup = BeautifulSoup.BeautifulSoup(retData)
	for item in soup.findAll('item'):
		print "Title: %s " % item.title.string.encode('utf-8')
		print "price_original: %s " % item('price_original')[0].string
		break
	return

if __name__ == "__main__":
	get_data()
